<!DOCTYPE html>
<html>

<head>
    <title>用车记录·车队管理系统</title>
    <style>
        .el-table .warning-row {
            background: oldlace;
        }

        .el-table .success-row {
            background: #f0f9eb;
        }
    </style>
    {include file="common/header"/}
    <el-main>
        <el-table :data="log" >
            <el-table-column prop="logid" label="ID">
            </el-table-column>
            <el-table-column prop="carid" label="车辆编号">
            </el-table-column>
            <el-table-column prop="license" label="车牌号" >
            </el-table-column>
            <el-table-column prop="userid" label="驾驶员编号" >
            </el-table-column>
            <el-table-column prop="name" label="驾驶员">
            </el-table-column>
            <el-table-column prop="start_date" label="开始时间">
            </el-table-column>
            <el-table-column prop="end_date" label="归还时间">
            </el-table-column>

        </el-table>
    </el-main>

    {include file="common/footer"/}
    <script>
        new Vue({
            el: '#app',
            data:{
                username:"",
                formEdit:{

                },
                log:{

                },
                dialogFormAdd:false,
                dialogFormEdit:false,
            },
            mounted () {
                // this.baiduMap();
                // this.username = getCookie('username');
                this.abcd();
                this.abc();
            },

            methods: {
                logOut() {
                    var that = this;
                    axios.post('user/logout')
                        .then(function (response)
                        {
                            if (response.data.code == 200) {
                                that.$message({
                                    message: '退出成功,正在跳转中',
                                    type: 'success'
                                });
                                setTimeout(function () {
                                    location.replace('');
                                }, 1000)
                            } else {
                                that.$message.error(response.data.msg);
                            }
                        })
                        .catch(function (error)
                        {
                            that.$message.error('tuichu失败，服务器内部错误');
                        })
                    ;

                },
                abc(){
                    var that = this;
                    axios.post('car_use/getalllog')
                        .then(function (response)
                        {
                            that.log = response.data.data;
                        })

                },
                abcd(){
                    var that = this;
                    axios.post('user/getmyvalue')
                        .then(function (response)
                        {
                            that.username = response.data.data.name;
                        })
                },
            }
        })
    </script>

</html>